package com.company.planner.entity;

import com.haulmont.chile.core.datatypes.impl.EnumClass;

import javax.annotation.Nullable;


public enum NestedLevel implements EnumClass<Integer> {

    ZERO(0),
    ONE(1),
    TWO(2),
    THERE(3),
    FOUR(4),
    FIVE(5);

    private Integer id;

    NestedLevel(Integer value) {
        this.id = value;
    }

    public Integer getId() {
        return id;
    }

    @Nullable
    public static NestedLevel fromId(Integer id) {
        for (NestedLevel at : NestedLevel.values()) {
            if (at.getId().equals(id)) {
                return at;
            }
        }
        return null;
    }
}